<template>
 <div>
    <van-search
    :id="inputObject.inputId"
  v-model="inputObject.userInput"
  show-action
  label="地址"
  placeholder="请输入搜索关键词"
  
>
  <template #action>
    <div id="searchBtn" @click="send">搜索</div>
  </template>
</van-search>
 </div>
</template>

<script>
//父子传参
import bus from "../../src/bus/bus"
export default {
    data() {
        return {
            inputObject:{
                userInput:'',
                inputId:'searchInput'

            }
        }
    },
    methods: {
        send() {
           bus.$emit('shareSearchData', this.inputObject) 
        }
    },
    mounted () {
        this.send();
    },
};
</script>

<style lang="scss" scoped>

</style>